package com.zaoniao.enstudy.api.vo;

import com.zaoniao.enstudy.domain.entity.VocabularyWords;
import com.zaoniao.enstudy.infracore.web.PagedGridResult;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Data
@Schema(name = "词汇表单词视图对象")
public class VocabularyWordsVo {
    @Schema(description = "词汇表唯一标识", name = "vocabularyId")
    private Integer vocabularyId;

    @Schema(description = "用户唯一标识openId", name = "userId")
    private String userId;

    @Schema(description = "用户唯一标识openId", name = "userId")
    private String word;

    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {

        VocabularyWordsVo.Converter INSTANCE = Mappers.getMapper(VocabularyWordsVo.Converter.class);

        /**
         * doList转voList
         *
         * @param vocabularyWords -
         * @return -
         */
        List<VocabularyWordsVo> do2VoList(List<VocabularyWords> vocabularyWords);

        VocabularyWordsVo do2vo(VocabularyWords vocabularyWord);

        PagedGridResult<VocabularyWordsVo> do2voPage(PagedGridResult<VocabularyWords> pagedGridResult);
    }
}
